Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autoware_probabilistic_occupancy_grid_map): fix bugprone-branch-clone #9652

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

kobayu858
Copy link
Contributor

Description

This is a fix based on clang-tidy bugprone-branch-clone error.

/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp:147:64: error: repeated branch in conditional chain [bugprone-branch-clone,-warnings-as-errors]
    if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
                                                               ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp:149:6: note: end of the original
    } else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
     ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp:149:84: note: clone 1 starts here
    } else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
                                                                                   ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_projective.cpp:156:64: error: repeated branch in conditional chain [bugprone-branch-clone,-warnings-as-errors]
    if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
                                                               ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_projective.cpp:158:6: note: end of the original
    } else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
     ^
/home/emb4/autoware/autoware/src/universe/autoware.universe/perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_projective.cpp:158:84: note: clone 1 starts here
    } else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
                                                                                   ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: kobayu858 <[email protected]>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Dec 16, 2024
Copy link

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kobayu858 kobayu858 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 16, 2024
@kobayu858 kobayu858 requested a review from veqcc December 16, 2024 02:33
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 29.88%. Comparing base (86ba21f) to head (a0d2389).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...p/lib/costmap_2d/occupancy_grid_map_projective.cpp 0.00% 4 Missing ⚠️
...id_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9652   +/-   ##
=======================================
  Coverage   29.88%   29.88%           
=======================================
  Files        1440     1440           
  Lines      108347   108353    +6     
  Branches    42467    42470    +3     
=======================================
+ Hits        32376    32379    +3     
- Misses      72730    72736    +6     
+ Partials     3241     3238    -3     
Flag Coverage Δ *Carryforward flag
differential 12.11% <25.00%> (?)
total 29.88% <ø> (+<0.01%) ⬆️ Carriedforward from 86ba21f

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@YoshiRi YoshiRi merged commit 6524f38 into autowarefoundation:main Dec 18, 2024
46 of 47 checks passed
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants